﻿
@{
    Layout = null;
    var error = ViewData["error"];
    Console.WriteLine(error);
}
<html>
<head>
    <title></title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/lib/jquery/jquery-1.12.4.min.js"></script>
    <script src="~/lib/layui/layui.js"></script>
    <link href="~/css/Login.css" rel="stylesheet" />
    <script src="~/lib/jsencrypt/jsencrypt.min.js"></script>
    <script> RsaPublicKey=""</script>
</head>
<body>
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md8 layui-col-md-offset2 ">
                <div class="layui-col-md6" style="padding: 25px;color:white">
                    <div style="text-align: center">
                        <h1>XXX系统后台管理</h1>
                    </div>
                </div>
                <div class="layui-col-md6 shadowblack"  style="background-color: rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 25px">
                    <div class="layui-logo" style="text-align: center; margin: 10px">
                        <img src="" alt="">
                    </div>
                    <form class="layui-form layui-form-pane" action="" method="post">
                        <div class="layui-form-item">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-block">
                                <input type="text" name="user" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><img src="@Url.Action("GetVerifyCode")"  onclick="this.src=this.src"  style="margin-top: -5px" /></label>
                            <div class="layui-input-block">
   
                                <input type="text" name="verifycode" placeholder="请输入验证码" autocomplete="off" class="layui-input">

                            </div>
                        </div>
                        <div class="layui-form-item ">
                            <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="demo2">跳转式提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md8 layui-col-md-offset2">
                <div class="layui-footer " style="border-top: solid 1px rgba(255,255,255,.3);margin: 20px 0;padding-top: 15px;color: white">
                    © 2018 All Rights Reserved. Wsy
                </div>
            </div>
        </div>

    </div>
<script>
    var error="@Html.Raw(Html.Encode(error))";
    layui.use(['form', 'layedit', 'laydate', 'layer'], function () {
        var layer = layui.layer;
        if (error!=="") {
            layer.alert("@error");
        }
        var form = layui.form;
        var crypt = new window.JSEncrypt();
        var publicKey ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsm9r+noXyrrJ2XIMiNckXna+y6yg/uA9sEmKP2ub4TGFdIkRgiLYRMGo2+D5Iu8byYwZZIzqVlU43RDeLBLXKdb92zdqEouhnHXw5jJ482G4gJTKMI0yAq8HDv3C8i2sk4ZvmJChVs7m5Frpik+6PdUagEwhgtot14f/e1lXBtAG8Pn5WLG9+SaM0z/UFmH3hRjt85VObXVG3BHZ+DBnzKQD3i7FxeblzK2mpASO0cW0wEqym4xUYGQ+yCeoJwnv1s7YqBtJqB15ztQsYMTD5UxNk3fKXw8rgId2qpi+EU15vwXTpBCQ0l1iRS8vI2Z1Y392WIe/Kilwrjkq5YougwIDAQAB";
        crypt.setPublicKey(publicKey);
        form.on('submit(demo2)', function (data) {
            $('input[name="password"]')[0].value = crypt.encrypt(data.field.password);
            return true;
        });
    });
</script>
<script>
    function middle() {
        //获取屏幕的高度
        var heightBig=window.innerHeight;
        //获取元素的高度
        var d1 = document.querySelector(".layui-container");
        var heightSmall = parseFloat(window.getComputedStyle(d1).height);
        d1.style.paddingTop = (heightBig - heightSmall) / 1000*382 + "px";
//        d1.style.padding=(heightBig-heightSmall)/2+"px auto";
    }
    middle();
    window.onresize=middle;

</script>
</body>
</html>
